package com.ruoyi.tsjData.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.tsjData.domain.plat.DataTshjZhdu;
import com.ruoyi.tsjData.mapper.DataTshjZhduMapper;
import com.ruoyi.tsjData.service.IDataTshjZhduService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.AsyncResult;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.concurrent.Future;


/**
 * 提升机照度测试项Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-02-28
 */
@Service
public class DataTshjZhduServiceImpl implements IDataTshjZhduService
{
    @Autowired
    private DataTshjZhduMapper dataTshjZhduMapper;

    /**
     * 查询提升机照度测试项
     * 
     * @param zhduId 提升机照度测试项主键
     * @return 提升机照度测试项
     */
    @Override
    public DataTshjZhdu selectDataTshjZhduByZhduId(Long zhduId)
    {
        return dataTshjZhduMapper.selectDataTshjZhduByZhduId(zhduId);
    }

    /**
     * 查询提升机照度测试项列表
     * 
     * @param dataTshjZhdu 提升机照度测试项
     * @return 提升机照度测试项
     */
    @Override
    public List<DataTshjZhdu> selectDataTshjZhduList(DataTshjZhdu dataTshjZhdu)
    {
        return dataTshjZhduMapper.selectDataTshjZhduList(dataTshjZhdu);
    }

    /**
     * 查询提升机照度测试项列表
     *
     * @param dataTaskId
     * @return 提升机照度测试项集合
     */
    @Async("threadPoolKy")
    @Override
    public Future<List<DataTshjZhdu>> selectDataTshjZhduByDataTaskId(Long dataTaskId) {
        return new AsyncResult<>(dataTshjZhduMapper.selectDataTshjZhduByDataTaskId(dataTaskId));
    }

    /**
     * 新增提升机照度测试项
     * 
     * @param dataTshjZhdu 提升机照度测试项
     * @return 结果
     */
    @Override
    public int insertDataTshjZhdu(DataTshjZhdu dataTshjZhdu)
    {
        dataTshjZhdu.setCreateTime(DateUtils.getNowDate());
        return dataTshjZhduMapper.insertDataTshjZhdu(dataTshjZhdu);
    }

    /**
     * 批量新增
     *
     * @param dataTshjZhdu
     */
    @Override
    public int batchDataTshjZhdu(List<DataTshjZhdu> dataTshjZhdu) {
        return dataTshjZhduMapper.batchDataTshjZhdu(dataTshjZhdu);
    }

    /**
     * 修改提升机照度测试项
     * 
     * @param dataTshjZhdu 提升机照度测试项
     * @return 结果
     */
    @Override
    public int updateDataTshjZhdu(DataTshjZhdu dataTshjZhdu)
    {
        dataTshjZhdu.setUpdateTime(DateUtils.getNowDate());
        return dataTshjZhduMapper.updateDataTshjZhdu(dataTshjZhdu);
    }

    /**
     * 修改提升机-照度测试
     *
     * @param dataTaskIds 照度测试任务id
     * @return 结果
     */
    @Override
    public int updateDataTshjZhduByDataTaskIds(Long[] dataTaskIds) {
        return dataTshjZhduMapper.updateDataTshjZhduByDataTaskIds(dataTaskIds);
    }

    /**
     * 修改测试数据状态变更2
     *
     * @param dataTaskId
     * @param zhduId
     */
    @Override
    public int updateDataTshjZhduByZhduId(Long dataTaskId, Long zhduId) {
        return dataTshjZhduMapper.updateDataTshjZhduByZhduId(dataTaskId, zhduId);
    }

    /**
     * 批量删除提升机照度测试项
     * 
     * @param zhduIds 需要删除的提升机照度测试项主键
     * @return 结果
     */
    @Override
    public int deleteDataTshjZhduByZhduIds(Long[] zhduIds)
    {
        return dataTshjZhduMapper.deleteDataTshjZhduByZhduIds(zhduIds);
    }

    /**
     * 删除提升机照度测试项信息
     * 
     * @param zhduId 提升机照度测试项主键
     * @return 结果
     */
    @Override
    public int deleteDataTshjZhduByZhduId(Long zhduId)
    {
        return dataTshjZhduMapper.deleteDataTshjZhduByZhduId(zhduId);
    }
}
